//object compatible
interface User{
    name:string;
    year:number;
}
let customer={
    name:'Bob',
    year:2010,
    address:'China'
}
let user:User=customer;
console.log(user);

//function compatible
let f1=(a:number,b:string)=>{};
let f2=(c:number,d:string,e:boolean)=>{};
f2=f1;

let g1=(a:number|string,b:string)=>{};
let g2=(c:number,d:string,e:boolean)=>{};
g2=g1;

let h1=()=>({name:'Alice'});
let h2=()=>({name:'Alice',gender:'female'});
h1=h2;

//enum compatible
enum Status{
    Pending,
    Resolved,
    Rejected
}
let current=Status.Pending;
let number=2;
current=number;
number=current;

//class compatible
class Animal{
    feet:number;
    constructor(name:string,count:number){};
}
class Size{
    feet:number;
    constructor(count:number){};
}
let a:Animal;
let s:Size;
a=s!;
s=a;

class Cat{
    protected feet:number;
    constructor(name:string,count:number){};
}
class Tiger extends Cat{};
let c:Cat;
let t:Tiger;
c=t!;
t=c;

//generic compatible
interface Empty<T>{};
let x:Empty<number>;
let y:Empty<string>;
x=y!;

let forward=function<T>(x:T):void{};
let reverse=function<U>(y:U):void{};
forward=reverse;
